<?php
/**
 * Created by PhpStorm.
 * User: Dave
 * Date: 2018/11/13
 * Time: 11:42
 */
//
ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';


use Biz\scraper\GoodsInfo;
use Biz\service\esSearch\Goods as esGoods;
use Biz\service\SearchGoods;
use Doraemon\tools\ShenJian;

//use Biz\service\activity\AllactivityInfoBak;
//use Biz\pockets\constInterface\ActivityInfo;
//use Biz\service\Sku;
//use Doraemon\pockets\constInterface\AppType;
//use Biz\pockets\constInterface\ActivityConfig;
//use Biz\module\Packages\AllActivity\MallTab;
//use Biz\model\activity\AllActivityGoods as mAllActivityGoods;
//use Biz\model\activity\AllActivitySku as mAllActivitySku;
//use Biz\module\Packages\Allactivity\ActivityAbstruct;
//use Biz\model\activity\ActivityRegisterGoods;
//use Biz\service\activity\ActivityRegisterInfo;
//use Biz\service\search\Goods;



$insertArray =  [2 => 2 , 4 => 4];
var_dump($insertArray);die;

$json = '{
    "data": [
        {
            "obj_id": [
                "406",
                "425",
                "91",
                "55"
            ],
            "obj_type": 10000
        }
    ]
}';

$data = json_decode($json, true);

foreach ($data['data'] as $key => &$list) {
var_dump($list);die;


}

var_dump($data);die;
$data = $data['hits']['hits'];
foreach ($data as $info) {

    echo $info['_source']['hot_rank'];
    echo PHP_EOL;
}
die;
\Doraemon\tools\LinkFormat::generateLink();

//use Doraemon\service\esSearch\UserPortrait;
$str = "【Dyson戴森 吹风机 Supersonic HD03 紫红 新增柔和风嘴】https://m.tb.cn/h.eNntreC?sm=22d688 点击链接，再选择浏览器咑閞；或椱ァ製这段描述👉b2p2Yn7nIBZ👈后到👉◇綯℡寳👈";
var_dump(GoodsInfo::checkTkl($str));die;

$a = '1';
$b = 'asd';

var_dump((int)$a, (int) $b);die;


var_dump(Doraemon\service\esSearch\UserPortrait::getUserInfoByUid([97346]));die;



$cateId = ["12",
    "13",
    "52",
    "53",
    "54",
    "55",
    "56",
    "57",
    "60",
    "61",
    "62",
    "64"];







$results = SearchGoods::searchEntrance(['category_id' => array_unique(array_filter($cateId)),
    'shop_id' => 4372030,
    'tag_content[!]' => '节选不展示', 'source' => esGoods::SOURCE_THE_PARAGRAPH],esGoods::SCENES_THE_PARAGRAPH_TAGS, 0, $page, 30);



var_dump($results);die;
$list = ['', ''];

if (!array_filter($list)) {
    echo 111;
    die;
}

var_dump();
die;
$str = GoodsInfo::getUrl('【【韩国仓直发】pogmang婴儿车安全座椅通用3D透气加厚气垫坐垫】https://m.tb.cn/h.e4SFnIL?sm=a57c3e 点击链接，再选择浏览器咑閞；或復·制这段描述￥03zeYVD4SqJ￥后到👉淘♂寳♀👈');

//$str = 'item.taobao.com/item.html?id=581239988157';
//$str = 'https://item.taobao.com/item.htm?id=10914230379';
$str = ShenJian::getGoodsInfo($str);

var_dump($str);
die;

//var_dump(json_encode(GoodsInfo::ge
//tWikiBasicInfo('https://item.jd.hk/6953681.html'), JSON_UNESCAPED_UNICODE));die;

// $str = 'https://item.jd.hk/6953681.html';

// $str = 'https://item.jd.com/21475433435.html';

// $str = ' 这是我的链接 https://item.m.jd.com/product/100003434260.html?wxa_abtest=o&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share&ShareTm=P/9%2B7Pyvy0zqOb0iTDXAOohTwLnVRneCDfHJAsWW6K/4BABLO6Q%2BK7RZvH1mQsmMW1qgHbw8FwMkqapKfqueuvyk5q7LY585DjsPJRnG1Bg39bFvq5CY5Nf/YjsO6pVJWv/Z7ya2KSjuk5JkHOtyWzbt5Fi2dCzx071SOgWjmso=';

//$str = 'https://item.jd.com/100000691964.html#none';

//$url = GoodsInfo::getUrl($str);
//$type = RealUrl::getUrlType($url);
//$id = RealUrl::getItemId($url);
//var_dump($url, $type, $id);die;

//
//$str = GoodsInfo::getUrl('【短袖T恤女2019新款夏季ins宽松套头韩版学生圆领套头印花上衣服】https://m.tb.cn/h.eevLA5r?sm=138ac8 点击链接，再选择浏览器咑閞；或復·制这段描述￥NenJYegbYAB￥后到👉手机天猫👈');
//
//$str = ShenJian::getGoodsInfo($str);
//var_dump(json_encode($str, JSON_UNESCAPED_UNICODE));die;
//$str = parse_url($str);










